how to retrieve an in-link as a text string?

Hi, I'm new to DXL, but what I'd like to do is, given an object and link module, I'd like to retrieve the full link path as a text string. How do I do this?

Right now I'm only able to retrieve the link reference, not the link path itself:

string sourceMod
for sourceMod in (newObject <- "/Path/To/Link Module") do
{
// body
}
Thanks for any help you can provide.
PSmith822 - Thu Dec 15 19:08:08 EST 2011

Re: how to retrieve an in-link as a text string?
OurGuest - Fri Dec 16 07:23:20 EST 2011

If you use the wizard to build a layout dxl and then examine the script you will see lines similar to following:

linkMod = module l
            if (getParentFolder(linkMod) == getParentFolder(current Module)) {
                s = name(linkMod)
            } else {
                s = fullName(linkMod)
            }
            s =  "[" s "]" 
            disp = disp  " " s

 


The s = fullName(linkMod) is the part that you are interested in.
You can change to something like s = path(linkMod) if you wish.

 

Re: how to retrieve an in-link as a text string?
llandale - Fri Dec 16 12:58:31 EST 2011

The string loop is hopeless, it only retrieves the base name of the module. If you use a "LinkRef" loop you should be able to get a handle on the Module at the other end of the LinkRef, then see OurGuest to convert that into a string name. Let me scribble, maybe you can figure it out:

LinkRef lr
ModuleVersion mv
string NameSourceFull
for lr in (newObject <- "/Path/To/Link Module") do
{  mv = sourceVersion(lr)
   NameSourceFull = fullName(mv)
}


-Louie